package Tools;
import java.sql.*;
public class TestSQLiteJDBC { 
	//e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855,project =BiThreadTree64

	
	
    public static void main(String args[]) { 
    	PreparedStatement ps = null;
    	Connection ct = null;
    	ResultSet rs = null;
        try { 
            Class.forName("SQLite.JDBCDriver"); 
            ct = DriverManager.getConnection("jdbc:sqlite:/d:/AnyviewJProjects/db/fingerPrint.db", "", ""); 
            ct.setAutoCommit(false); 
            String path = "1patrrsss";
            String filePrint = "fififfif";
            String projName = "tree";
           
            //ps = ct.prepareStatement("SELECT *FROM fileprint");//"INSERT INTO fileprint(path,mark,project) VALUES('" + path + "','" + filePrint + "','" + projName + "')"); 
//			ps = ct.prepareStatement("delete from fileprint");//"INSERT INTO fileprint(path,mark,project) VALUES('" + path + "','" + filePrint + "','" + projName + "')"); 
//
//            ps.executeUpdate();

            
            
            
            
            
            
            ps = ct.prepareStatement("SELECT *FROM fileprint");//"INSERT INTO fileprint(path,mark,project) VALUES('" + path + "','" + filePrint + "','" + projName + "')"); 
			//ps = ct.prepareStatement("delete from fileprint");//"INSERT INTO fileprint(path,mark,project) VALUES('" + path + "','" + filePrint + "','" + projName + "')"); 

            //ps.executeUpdate();
            //ps = new PreparedStatement();
			rs = ps.executeQuery();  
            while (rs.next()){ 
                String id = rs.getString(1); 
                String name = rs.getString(2); 
                String jet = rs.getString(3);
                System.out.println("id = " + id + ", name = " + name + ",project =" + jet); 
            } 

            rs.close();
            ps.close();  
 
            ct.commit(); 
            ct.close(); 
        } catch (Exception e) { 
            e.printStackTrace(); 
            System.exit(1); 
            try { 
                if (ct != null && !ct.isClosed()) { 
                    ct.rollback(); 
                    ct.close(); 
                } 
            } catch (SQLException sql) { 
                // do nothing 
            } 
        } 
    } 
 
} 
